/*
 * Copyright (c) 2013 iTAC Software AG, Germany. All Rights Reserved.
 * 
 * This software is protected by copyright. Under no circumstances may any part of this file in any form be copied,
 * printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language
 * without the written permission of iTAC Software AG.
 */
package org.template.portal;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * @author rafal.kojta
 */
@Entity
@Table(name = "location")
public class Location {

  @Id
  @GeneratedValue(strategy = IDENTITY)
  @Column(name = "LOCATION_ID", unique = true, nullable = false)
  private long locationId;

  @ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "STUDENT_ID")
  private Student student;

  @OneToMany(fetch = FetchType.LAZY, mappedBy = "location")
  private Set<Opinion> opinions;

  @Column(name = "CORD_X")
  private double cordX;

  @Column(name = "CORD_Y")
  private double cordY;

  @Column(name = "TITLE")
  private String title;

  @Column(name = "CONTENT")
  private String content;

  @Column(name = "GOOD_VOTE_COUNT")
  private int goodVoteCount;

  @Column(name = "BAD_VOTE_COUNT")
  private int badVoteCount;

  public Location() {
  }

  public long getLocationId() {
    return locationId;
  }

  public void setLocationId(long locationId) {
    this.locationId = locationId;
  }

  public Student getStudent() {
    return student;
  }

  public void setStudent(Student student) {
    this.student = student;
  }

  public Set<Opinion> getOpinions() {
    return opinions;
  }

  public void setOpinions(Set<Opinion> opinions) {
    this.opinions = opinions;
  }

  public double getCordX() {
    return cordX;
  }

  public void setCordX(double cordX) {
    this.cordX = cordX;
  }

  public double getCordY() {
    return cordY;
  }

  public void setCordY(double cordY) {
    this.cordY = cordY;
  }

  public String getTitle() {
    return title;
  }

  public void setTitle(String title) {
    this.title = title;
  }

  public String getContent() {
    return content;
  }

  public void setContent(String content) {
    this.content = content;
  }

  public int getGoodVoteCount() {
    return goodVoteCount;
  }

  public void setGoodVoteCount(int goodVoteCount) {
    this.goodVoteCount = goodVoteCount;
  }

  public int getBadVoteCount() {
    return badVoteCount;
  }

  public void setBadVoteCount(int badVoteCount) {
    this.badVoteCount = badVoteCount;
  }
}
